package gui;
import java.awt.event.ActionListener;

import javax.swing.JFrame;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

public class CreateGroupPanel1 extends javax.swing.JPanel {

	public CreateGroupPanel1(ActionListener listener) {
		initComponents(listener);
	}

	@SuppressWarnings("unchecked")
	private void initComponents(ActionListener listener) {

		GroupNameLabel = new javax.swing.JLabel();
		BeskrivLabel2 = new javax.swing.JLabel();
		groupNameTextField = new javax.swing.JTextField();
		jScrollPane1 = new javax.swing.JScrollPane();
		beskrivTextArea = new javax.swing.JTextArea();
		NextButton = new javax.swing.JButton();

		GroupNameLabel.setFont(new java.awt.Font("Tahoma", 0, 20)); // NOI18N
		GroupNameLabel.setText("Gruppnamn:");

		BeskrivLabel2.setFont(new java.awt.Font("Tahoma", 0, 20)); // NOI18N
		BeskrivLabel2.setText("Beskringvning:");

		beskrivTextArea.setColumns(20);
		beskrivTextArea.setRows(5);
		beskrivTextArea.setLineWrap(true);
		jScrollPane1.setViewportView(beskrivTextArea);

		NextButton.setFont(new java.awt.Font("Tahoma", 2, 14));
		NextButton.setText("Next");
		NextButton.setActionCommand("Next");
		NextButton.addActionListener(listener);

		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
		this.setLayout(layout);
		layout.setHorizontalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						layout.createSequentialGroup()
								.addGap(62, 62, 62)
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.LEADING)
												.addComponent(
														jScrollPane1,
														javax.swing.GroupLayout.PREFERRED_SIZE,
														300,
														javax.swing.GroupLayout.PREFERRED_SIZE)
												.addComponent(
														groupNameTextField,
														javax.swing.GroupLayout.PREFERRED_SIZE,
														150,
														javax.swing.GroupLayout.PREFERRED_SIZE)
												.addComponent(BeskrivLabel2)
												.addComponent(GroupNameLabel))
								.addGap(0, 85, Short.MAX_VALUE))
				.addGroup(
						javax.swing.GroupLayout.Alignment.TRAILING,
						layout.createSequentialGroup()
								.addContainerGap(
										javax.swing.GroupLayout.DEFAULT_SIZE,
										Short.MAX_VALUE)
								.addComponent(NextButton).addContainerGap()));
		layout.setVerticalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						layout.createSequentialGroup()
								.addGap(25, 25, 25)
								.addComponent(GroupNameLabel)
								.addPreferredGap(
										javax.swing.LayoutStyle.ComponentPlacement.RELATED)
								.addComponent(groupNameTextField,
										javax.swing.GroupLayout.PREFERRED_SIZE,
										javax.swing.GroupLayout.DEFAULT_SIZE,
										javax.swing.GroupLayout.PREFERRED_SIZE)
								.addPreferredGap(
										javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
								.addComponent(BeskrivLabel2)
								.addPreferredGap(
										javax.swing.LayoutStyle.ComponentPlacement.RELATED)
								.addComponent(jScrollPane1,
										javax.swing.GroupLayout.PREFERRED_SIZE,
										100,
										javax.swing.GroupLayout.PREFERRED_SIZE)
								.addPreferredGap(
										javax.swing.LayoutStyle.ComponentPlacement.RELATED,
										66, Short.MAX_VALUE)
								.addComponent(NextButton).addGap(22, 22, 22)));
	}
	
    public boolean checkTextFields(){
    	try{
    	return (groupNameTextField.getText() != null && beskrivTextArea.getText()!=null);
    			}
    	catch(NullPointerException nPE){
    		System.out.println(nPE.getStackTrace());
    	}
    	return false;
    }
	
	public String[] getInfo(){
    	String[] string = new String[2];
    	string[0]=groupNameTextField.getText();
    	string[1]=beskrivTextArea.getText();    		
    	return string;
    }
	
	// Variables declaration - do not modify
	private javax.swing.JLabel BeskrivLabel2;
	private javax.swing.JTextArea beskrivTextArea;
	private javax.swing.JLabel GroupNameLabel;
	private javax.swing.JTextField groupNameTextField;
	private javax.swing.JButton NextButton;
	private javax.swing.JScrollPane jScrollPane1;
	// End of variables declaration
}